package com.liangzhong.model.goldpalace.vo
{
	/**
	 *黄金12宫vo 
	 * @author lake
	 * 
	 */	
	public class GoldPalaceVo
	{
		/**
		 *球星id组合 
		 */		
		public var starIds :Array = [];//[1378,1171,1408,1966,1967,61,1946,1945,1938,1943,1920];
		/**
		 *激活组合
		 * 0 未激活
		 * 1 已激活 
		 */		
		public var actives :Array = [];
		/**
		 *冷却时间 day
		 */		
		public var times	:Array = [1,1,1,1,1,1,2,2,3,4,5,7];
		/**
		 *加速点券 
		 */		
		public var fcashs  :Array = [5,10,20,25,25,100,150,150,650,850,4500,80000];
		/**
		 * 激活状态 (激活球员个数)
			1-12
		 */		
		public var active 		:int = 1;
		/**
		 * 每日奖励是否领取
			0.不可领取 1.可领取 2.已领取
		 */		
		public var status 		:int;
		/**
		 * 奖励开始时间
		 */		
		public var begintime 	:int;
		/**
		 *奖励 
		 */		
		public var awards		:Array = [];
		/**
		 *奖励的位置 1 - 12 
		 */		
		public var awardPos		:int = 0;
		/**
		 *道具id 
		 */		
		public var id 		:int;
		/**
		 *道具类型 
		 */		
		public var ntype 	:int;
		/**
		 *球员id数组 未激活
		 */		
		public var unStarIds 	:Array = [];
		
		public function GoldPalaceVo()
		{
			awards.push({type:5,id:8});
			awards.push({type:5,id:15});
			awards.push({type:5,id:16});
			awards.push({type:5,id:2});
			awards.push({type:5,id:9});
			awards.push({type:5,id:17});
			awards.push({type:5,id:3});
			awards.push({type:5,id:10});
			awards.push({type:5,id:4});
			awards.push({type:5,id:18});
			awards.push({type:5,id:19});
			awards.push({type:5,id:20});
			begintime = int(new Date().time/1000);
		}
		/**
		 *解析数据 
		 * @param data
		 * 
		 */		
		public function parse(data :Object):void
		{
			for (var str:String in data)
			{
				if(this.hasOwnProperty(str))
				{
					this[str] = data[str];
				}
			}
			starIds = [];
			actives = [];
			var i :int = 2;
			for(;i<=12;i++)
			{
				starIds.push(int(data["starid" + i]));
				actives.push(int(data["active" + i]));
				if(data["active" + i] == 0)
				{
					unStarIds.push(int(data["starid" + i]));
				}
			}
			i = 1;
			for each(var awObj :Object in awards)
			{
				if(awObj.id == id && awObj.type == ntype)
				{
					awardPos = i;
				}
				i ++;
			}
		}
	}
}